package net.zoneland.knowledge.model;

import java.io.Serializable;
import java.util.List;
import java.util.Optional;

import com.google.common.collect.Lists;

/**
 * 场景问答问题.
 *
 * @author: bcc
 * 2020/6/29
 */
public class Chat implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 问题.
     */
    private String question;

    /**
     * 回答.多个回答随机取一个答案.
     */
    private List<String> answer;

    /**
     * .
     *
     * @return question
     */
    public String getQuestion() {
        return question;
    }

    /**
     * .
     *
     * @param question to set
     */
    public void setQuestion(final String question) {
        this.question = question;
    }

    /**
     * .
     *
     * @return answer
     */
    public List<String> getAnswer() {
        return Optional.ofNullable(answer).map(it -> Lists.newArrayList(it.iterator())).orElse(null);
    }

    /**
     * .
     *
     * @param answer to set
     */
    public void setAnswer(final List<String> answer) {
        this.answer = Optional.ofNullable(answer).map(it -> Lists.newArrayList(it.iterator())).orElse(null);
    }
}
